const Koa = require('koa');
const router = require('koa-router')();
const render = require('koa-art-template');
const {resolve} = require('path');
const static = require('koa-static');
const app = new Koa();
/* 配置模板引擎 */
app.use(static(resolve(__dirname,'static')))
render(app, {
    root: resolve(__dirname, 'views'),
    extname: '.html',
    debug: process.env.NODE_ENV !== 'production'
});
router.get('/', async ctx => {
    await ctx.render('index',{name:"chengchao",isShow:true,arr:['HTML','CSS','Javascript'],title:"测试"})
})
app.use(router.routes()).use(router.allowedMethods())
app.listen(8080)